<?php
namespace Tbf\Bundle\CallbackSerializerBundle\Wrapper;
use Tbf\Bundle\CallbackSerializerBundle\CallbackInterface;

/**
 * callback序列化用wrapper
 */
class CallbackWrapper implements CallbackInterface{
    protected $callback;
    function __construct(CallbackInterface $callback){
        $this->callback = $callback;
    }
    /**
     * 可序列化回调接口
     * @param mixed $data //输入数据
     * @return mixed //输出数据
     */
    function invoke($data = null)
    {
        return $this->callback->invoke($data);
    }

    /**
     * @return \Tbf\Bundle\CallbackSerializerBundle\CallbackInterface
     */
    public function getCallback()
    {
        return $this->callback;
    }

}